<?php
  /**
  * QuickSkin Extension number
  * Format a number with grouped thousands
  *
  * Usage Example:
  * Content:  $template->assign('SUM', 2500000);
  * Template: Current balance: {number:SUM}
  * Result:   Current balance: 2.500.000,00
  *
  * @author Andy Prevost andy@codeworxtech.com - original by Philipp v. Criegern philipp@criegern.de
  */
  function qx_number ( $param ) {
    global $_CONFIG;

    if (empty($_CONFIG['decimal_char'])) {
      $_CONFIG['decimal_char']  =  ',';
    }
    if (empty($_CONFIG['decimal_places'])) {
      $_CONFIG['decimal_places']  =  2;
    }
    if (empty($_CONFIG['thousands_sep'])) {
      $_CONFIG['thousands_sep']  =  '.';
    }

    return number_format( $param, $_CONFIG['decimal_places'], $_CONFIG['decimal_char'], $_CONFIG['thousands_sep'] );
  }

?>
